package red.mlz.consoleconsumer.feign.excel;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;
import red.mlz.consoleconsumer.config.FeignConfig;

@FeignClient(name = "excel-service",configuration = FeignConfig.class)
public interface ExcelFeign {

    @RequestMapping(value = "/excel/upload",consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    String upload(@RequestPart(name = "file") MultipartFile file,
                         @RequestParam(value = "headerRow", defaultValue = "0") int headerRow);

    @RequestMapping("/export/categories")
    ResponseEntity<byte[]> exportCategories();
}
